<?php /*a:2:{s:40:"D:\www\long_shop\app\view\user\edit.html";i:1702389679;s:42:"D:\www\long_shop\app\view\common\head.html";i:1702389678;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="/static/jquery/jquery-1.12.4.min.js"></script>    
    <link href="/static/bst5.3.2/css/bootstrap.min.css" rel="stylesheet">
    <script src="/static/bst5.3.2/js/bootstrap.bundle.min.js"></script>
    <link rel="stylesheet" href="/static/bst-icons/font/bootstrap-icons.css">
    <script src="/static/layer/layer/layer.js"></script>
    <link rel="stylesheet" href="/static/css/my.css">    
</head>
<head>
<title>员工信息编辑</title>

<style type="">
  label{width: 18%;}
  .form-control{display:inline-block;width: 80%;}  
</style>
</head>
<body style="">
    <div class="container p-3 my-3 " style="max-width: 600px;"  >
    <h2>员工信息编辑 【工号:<?php echo htmlentities($data['uid']); ?>】</h2>
    <form method="post" enctype="multipart/form-data" action="/index.php/user/edit">

      <input type="hidden" name="id" id="id" value="<?php echo htmlentities($data['id']); ?>" />
      <div class="mb-3 mt-3">
        <label for="dept_id" class="form-label">部门:</label>
        <select id="dept_id" name="dept_id" class="form-control">
            <?php foreach($dept as $k=>$v): if($k==$data['dept_id']): ?>
                    <option value="<?php echo htmlentities($k); ?>" selected ><?php echo htmlentities($v['name']); ?></option>
                <?php else: ?>
                    <option value="<?php echo htmlentities($k); ?>" ><?php echo htmlentities($v['name']); ?></option>
                <?php endif; ?>
            <?php endforeach; ?>
        </select>
      </div>
<!--       <div class="mb-3 mt-3">
        <label for="level" class="form-label">职务级别:</label>
        <select id="level" name="level" class="form-control">
            <?php foreach($levels as $k=>$v): if($k==$data['level']): ?>
                    <option value="<?php echo htmlentities($k); ?>" selected ><?php echo htmlentities($v); ?></option>
                <?php else: ?>
                    <option value="<?php echo htmlentities($k); ?>" ><?php echo htmlentities($v); ?></option>
                <?php endif; ?>
            <?php endforeach; ?>
        </select>
      </div>    -->

      <!--平台管理员，人事部门才能更改员工权限-->
      <?php if($me['group_id']<3): ?> 
      <div class="mb-3 mt-3">
        <label for="group_id" class="form-label">权限组:</label>
        <select id="group_id" name="group_id" class="form-control">
            <?php foreach($group as $k=>$v): if($k==$data['group_id']): ?>
                    <option value="<?php echo htmlentities($k); ?>" selected ><?php echo htmlentities($v['name']); ?></option>
                <?php else: ?>
                    <option value="<?php echo htmlentities($k); ?>" ><?php echo htmlentities($v['name']); ?></option>
                <?php endif; ?>
            <?php endforeach; ?>
        </select>
      </div>
      <?php endif; ?>

<hr/>
      <div class="mb-3 mt-3">
        <!-- <label for="name" class="form-label">工号:</label> -->
        <input type="hidden" class="form-control" id="uid" name="uid" value="<?php echo htmlentities($data['uid']); ?>" placeholder="工号(登录帐号)" disabled />
      </div>
      <div class="mb-3">
        <label for="title" class="form-label">登录账号:</label>
        <input type="text" class="form-control" id="uid" name="uid" value="<?php echo htmlentities($data['uid']); ?>" placeholder="登录账号" />
      </div>
      <div class="mb-3">
        <label for="title" class="form-label">姓名:</label>
        <input type="text" class="form-control" id="name" name="name" value="<?php echo htmlentities($data['name']); ?>" placeholder="姓名" />
      </div>
      <div class="mb-3">
        <label for="id_card" class="form-label">身份证号码:</label>
        <input type="text" class="form-control" id="id_card" name="id_card" value="<?php echo htmlentities($data['id_card']); ?>" placeholder="身份证号码" />
      </div>      
      <div class="mb-3">
        <label for="mobile" class="form-label">手机号码:</label>
        <input type="text" class="form-control" id="mobile" name="mobile" value="<?php echo htmlentities($data['mobile']); ?>" placeholder="Mobile" />
      </div>
      <div class="mb-3">
        <label for="wx" class="form-label">微信:</label>
        <input type="text" class="form-control" id="wx" name="wx" value="<?php echo htmlentities($data['wx']); ?>" placeholder="wx/facebook" />
      </div>   
       
      <div class="mb-3">
        <label for="address" class="form-label">居住地址:</label>
        <input type="text" class="form-control" id="address" name="address" value="<?php echo htmlentities($data['address']); ?>" placeholder="居住地址" />
      </div>        

      <div class="mb-3">
        <label for="sex" class="form-label">性别:</label>
          <input type="radio" class="form-check-input" id="radio1" name="sex" value="1" <?php if($data['sex']==1): ?> checked <?php endif; ?>/> 
          <label class="form-check-label" for="radio1">男士</label>
          <input type="radio" class="form-check-input" id="radio2" name="sex" value="2" <?php if($data['sex']==2): ?> checked <?php endif; ?>/>
          <label class="form-check-label" for="radio2">女士</label>
      </div>

      <div class="mb-3">
        <label for="status" class="form-label">是否在职:</label>
          <input type="radio" class="form-check-input" id="radio3" name="status" value="1" <?php if($data['status']==1): ?> checked <?php endif; ?>/> 
          <label class="form-check-label" for="radio3">在职</label>
          <input type="radio" class="form-check-input" id="radio4" name="status" value="2" <?php if($data['status']==2): ?> checked <?php endif; ?>/>
          <label class="form-check-label" for="radio4">离职</label>
          <input type="radio" class="form-check-input" id="radio5" name="status" value="3" <?php if($data['status']==3): ?> checked <?php endif; ?>/>
          <label class="form-check-label" for="radio5">黑名单</label>          
       </div>

      <div class="mb-3">
        <img src="<?php echo htmlentities($data['image']); ?>" style="width: 140px;"/><br />
        <label for="file" class="form-label">上传图片(Image):</label>
        <input type="file"  name="file" /> <br> 
      </div>   
      <button  type="button" class="btn btn-primary" onclick="doSave()">保存员工资料</button>

    </form>
    </div>

<script type="text/javascript">
    function doSave(){
      if(!$("#name").val()) {
        layer.msg("无效的名称(Invalid name)!");
        return 0;
      }    
      //询问框
      layer.confirm('是否确定保存?', {
        btn: ['YES','CANCEL'] //按钮
      }, function(){
        $('form').submit();
      }, function(){
        layer.msg("Cancel!");
        return 0;
      });
    }

</script>


</body>
</html>
